<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    二、用代码实例几种常见的创建对象方式？
</body>
</html>
<script>
    var obj = new Object()
    var person={name:"韩文侨",age:18}
    console.log(person,111);


    function Student(name,age){
        this.name=name;
        this.age=age;
        this.study=function(){
            console.log(this.name,222);
        }
    }
    var stu1 = new Student("hwq",18)
        console.log(stu1.name);
        console.log(stu1.age);
        stu1.study()


        function Person(){}
            Person.prototype={
                name:"ll",
                age:18,
                family:["姐姐","妹妹","弟弟"],
                fun:function(){
                    return this.name+this.age+this.family;
                }
            }
            var stu1=new Person()
            stu1.name="hh";
            console.log(stu1.name);
            stu1.family.push("妹妹");
            console.log(stu1.family);
            var stu2 = new Person()
            console.log(stu2.name);
            console.log(stu2.family);
        
</script>